package com.example.util;

import java.math.RoundingMode;
import java.text.DecimalFormat;

public class FormatUtil {

    public static DecimalFormat decimalFormat(int fractions){
        DecimalFormat df = new DecimalFormat("#0.0");
        df.setRoundingMode(RoundingMode.HALF_UP);
        df.setMinimumFractionDigits(fractions);
        df.setMaximumFractionDigits(fractions);
        return df;
    }
}
